﻿using System.ComponentModel;
using SampleApplication.Resources;

namespace SampleApplication.Localization
{
    public class LocalizedDescriptionAttribute : DescriptionAttribute
    {
        private readonly string _resourceKey;

        public LocalizedDescriptionAttribute(string resourceKey)
            : base()
        {
            _resourceKey = resourceKey;
        }

        public override string Description
        {
            get
            {
                // this uses the default Windows Phone 8 AppResources.resx
                return AppResources.ResourceManager.GetString(_resourceKey);
            }
        }
    }
}
